/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.service.impl;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yami.shop.bean.model.Area;
import com.yami.shop.bean.model.LoginHist;
import com.yami.shop.dao.AreaMapper;
import com.yami.shop.dao.LoginHistMapper;
import com.yami.shop.service.AreaService;
import com.yami.shop.service.LoginHistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;

/**
 * @author lgh on 2018/10/26.
 */
@Service
public class LoginHistServiceImpl extends ServiceImpl<LoginHistMapper, LoginHist> implements LoginHistService {
    @Autowired
    private LoginHistMapper loginHistMapper;

    @Override
    public int countByAccountToday() {
        Date now = new Date();
        int i = loginHistMapper.countByAccount(DateUtil.beginOfDay(now), DateUtil.endOfDay(now));
        return i;
    }
}
